<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="linux,curl," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="转载：https://gist.github.com/303182519/132568fd0e58cae57202， 版权归原作者所有。
参考资料
http://bbs.et8.net/bbs/showthread.php?t=568472
http://www.ruanyifeng.com/blog/2011/09/curl.html

下载单个文件，默认将输出打印到标准输出中(STDOUT)中">
<meta property="og:type" content="article">
<meta property="og:title" content="Linux常用命令注记——CURL">
<meta property="og:url" content="http://chrisrc.me/2014/01/01/linux-commands-curl/index.html">
<meta property="og:site_name" content="山中，山外与俯瞰">
<meta property="og:description" content="转载：https://gist.github.com/303182519/132568fd0e58cae57202， 版权归原作者所有。
参考资料
http://bbs.et8.net/bbs/showthread.php?t=568472
http://www.ruanyifeng.com/blog/2011/09/curl.html

下载单个文件，默认将输出打印到标准输出中(STDOUT)中">
<meta property="og:updated_time" content="2016-12-17T04:04:23.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Linux常用命令注记——CURL">
<meta name="twitter:description" content="转载：https://gist.github.com/303182519/132568fd0e58cae57202， 版权归原作者所有。
参考资料
http://bbs.et8.net/bbs/showthread.php?t=568472
http://www.ruanyifeng.com/blog/2011/09/curl.html

下载单个文件，默认将输出打印到标准输出中(STDOUT)中">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://chrisrc.me/2014/01/01/linux-commands-curl/"/>





  <title> Linux常用命令注记——CURL | 山中，山外与俯瞰 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">山中，山外与俯瞰</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">一次永不停止的探索之旅</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-dcos">
          <a href="/dcos" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br />
            
            DC/OS
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="st-search-show-outputs">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'R9GcmhBwxpsAGLNCsquZ','2.0.0');
</script>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://chrisrc.me/2014/01/01/linux-commands-curl/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="chrisrc">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="山中，山外与俯瞰">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="山中，山外与俯瞰" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Linux常用命令注记——CURL
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2014-01-01T01:01:01+08:00">
                2014-01-01
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index">
                    <span itemprop="name">Linux</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <a href="/2014/01/01/linux-commands-curl/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/01/01/linux-commands-curl/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><strong>转载</strong>：<a href="https://gist.github.com/303182519/132568fd0e58cae57202，" target="_blank" rel="external">https://gist.github.com/303182519/132568fd0e58cae57202，</a> 版权归原作者所有。</p>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><ul>
<li><a href="http://bbs.et8.net/bbs/showthread.php?t=568472" target="_blank" rel="external">http://bbs.et8.net/bbs/showthread.php?t=568472</a></li>
<li><a href="http://www.ruanyifeng.com/blog/2011/09/curl.html" target="_blank" rel="external">http://www.ruanyifeng.com/blog/2011/09/curl.html</a></li>
</ul>
<h3 id="下载单个文件，默认将输出打印到标准输出中-STDOUT-中"><a href="#下载单个文件，默认将输出打印到标准输出中-STDOUT-中" class="headerlink" title="下载单个文件，默认将输出打印到标准输出中(STDOUT)中"></a>下载单个文件，默认将输出打印到标准输出中(STDOUT)中</h3><pre><code>curl http://www.centos.org
</code></pre><h3 id="通过-o-O选项保存下载的文件到指定的文件中："><a href="#通过-o-O选项保存下载的文件到指定的文件中：" class="headerlink" title="通过-o/-O选项保存下载的文件到指定的文件中："></a>通过-o/-O选项保存下载的文件到指定的文件中：</h3><blockquote>
<ol>
<li>-o：将文件保存为命令行中指定的文件名的文件中</li>
<li>-O：使用URL中默认的文件名保存文件到本地</li>
</ol>
</blockquote>
<pre><code># 将文件下载到本地并命名为mygettext.html
  curl -o mygettext.html http://www.gnu.org/software/gettext/manual/gettext.html

# 将文件保存到本地并命名为gettext.html
  curl -O http://www.gnu.org/software/gettext/manual/gettext.html
</code></pre><p>同样可以使用转向字符”&gt;”对输出进行转向输出</p>
<h3 id="同时获取多个文件"><a href="#同时获取多个文件" class="headerlink" title="同时获取多个文件"></a>同时获取多个文件</h3><pre><code>curl -O URL1 -O URL2
</code></pre><p>若同时从同一站点下载多个文件时，curl会尝试重用链接(connection)。</p>
<p>通过-L选项进行重定向<br>默认情况下CURL不会发送HTTP Location headers(重定向).当一个被请求页面移动到另一个站点时，会发送一个HTTP Loaction header作为请求，然后将请求重定向到新的地址上。<br>例如：访问google.com时，会自动将地址重定向到google.com.hk上。</p>
<pre><code>curl http://www.google.com
&lt;HTML&gt;
&lt;HEAD&gt;
    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html;charset=utf-8&quot;&gt;
    &lt;TITLE&gt;302 Moved&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
    &lt;H1&gt;302 Moved&lt;/H1&gt;
    The document has moved
    &lt;A HREF=&quot;http://www.google.com.hk/url?sa=p&amp;amp;hl=zh-CN&amp;amp;pref=hkredirect&amp;amp;pval=yes&amp;amp;q=http://www.google.com.hk/&amp;amp;ust=1379402837567135amp;usg=AFQjCNF3o7umf3jyJpNDPuF7KTibavE4aA&quot;&gt;here&lt;/A&gt;.
&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre><p>上述输出说明所请求的档案被转移到了<a href="http://www.google.com.hk。" target="_blank" rel="external">http://www.google.com.hk。</a></p>
<p>这是可以通过使用-L选项进行强制重定向</p>
<pre><code>让curl使用地址重定向，此时会查询google.com.hk站点
curl -L http://www.google.com
</code></pre><h3 id="断点续传"><a href="#断点续传" class="headerlink" title="断点续传"></a>断点续传</h3><p>通过使用-C选项可对大文件使用断点续传功能，如：</p>
<pre><code># 当文件在下载完成之前结束该进程
$ curl -O http://www.gnu.org/software/gettext/manual/gettext.html
##############             20.1%

# 通过添加-C选项继续对该文件进行下载，已经下载过的文件不会被重新下载
curl -C - -O http://www.gnu.org/software/gettext/manual/gettext.html
###############            21.1%
</code></pre><h3 id="对CURL使用网络限速"><a href="#对CURL使用网络限速" class="headerlink" title="对CURL使用网络限速"></a>对CURL使用网络限速</h3><p>通过–limit-rate选项对CURL的最大网络使用进行限制</p>
<pre><code>下载速度最大不会超过1000B/second

curl --limit-rate 1000B -O http://www.gnu.org/software/gettext/manual/gettext.html
</code></pre><p>下载指定时间内修改过的文件</p>
<p>当下载一个文件时，可对该文件的最后修改日期进行判断，如果该文件在指定日期内修改过，就进行下载，否则不下载。<br>该功能可通过使用-z选项来实现：</p>
<pre><code>若yy.html文件在2011/12/21之后有过更新才会进行下载
curl -z 21-Dec-11 http://www.example.com/yy.html
</code></pre><h3 id="CURL授权"><a href="#CURL授权" class="headerlink" title="CURL授权"></a>CURL授权</h3><p>在访问需要授权的页面时，可通过-u选项提供用户名和密码进行授权</p>
<pre><code>curl -u username:password URL

# 通常的做法是在命令行只输入用户名，之后会提示输入密码，这样可以保证在查看历史记录时不会将密码泄露
curl -u username URL
</code></pre><h3 id="从FTP服务器下载文件"><a href="#从FTP服务器下载文件" class="headerlink" title="从FTP服务器下载文件"></a>从FTP服务器下载文件</h3><p>CURL同样支持FTP下载，若在url中指定的是某个文件路径而非具体的某个要下载的文件名，CURL则会列出该目录下的所有文件名而并非下载该目录下的所有文件</p>
<pre><code># 列出public_html下的所有文件夹和文件
curl -u ftpuser:ftppass -O ftp://ftp_server/public_html/

# 下载xss.php文件
curl -u ftpuser:ftppass -O ftp://ftp_server/public_html/xss.php
</code></pre><h3 id="上传文件到FTP服务器"><a href="#上传文件到FTP服务器" class="headerlink" title="上传文件到FTP服务器"></a>上传文件到FTP服务器</h3><p>通过 -T 选项可将指定的本地文件上传到FTP服务器上</p>
<pre><code># 将myfile.txt文件上传到服务器
curl -u ftpuser:ftppass -T myfile.txt ftp://ftp.testserver.com

# 同时上传多个文件
curl -u ftpuser:ftppass -T &quot;{file1,file2}&quot; ftp://ftp.testserver.com

# 从标准输入获取内容保存到服务器指定的文件中
curl -u ftpuser:ftppass -T - ftp://ftp.testserver.com/myfile_1.txt
</code></pre><h3 id="获取更多信息"><a href="#获取更多信息" class="headerlink" title="获取更多信息"></a>获取更多信息</h3><p>通过使用 -v 和 -trace获取更多的链接信息</p>
<h3 id="通过字典查询单词"><a href="#通过字典查询单词" class="headerlink" title="通过字典查询单词"></a>通过字典查询单词</h3><pre><code># 查询bash单词的含义
curl dict://dict.org/d:bash

# 列出所有可用词典
curl dict://dict.org/show:db

# 在foldoc词典中查询bash单词的含义
curl dict://dict.org/d:bash:foldoc
</code></pre><h3 id="为CURL设置代理"><a href="#为CURL设置代理" class="headerlink" title="为CURL设置代理"></a>为CURL设置代理</h3><p>x 选项可以为CURL添加代理功能</p>
<pre><code># 指定代理主机和端口
curl -x proxysever.test.com:3128 http://google.co.in
</code></pre><h3 id="保存与使用网站cookie信息"><a href="#保存与使用网站cookie信息" class="headerlink" title="保存与使用网站cookie信息"></a>保存与使用网站cookie信息</h3><pre><code># 将网站的cookies信息保存到sugarcookies文件中
curl -D sugarcookies http://localhost/sugarcrm/index.php

# 使用上次保存的cookie信息
curl -b sugarcookies http://localhost/sugarcrm/index.php
</code></pre><h3 id="传递请求数据"><a href="#传递请求数据" class="headerlink" title="传递请求数据"></a>传递请求数据</h3><p>默认curl使用GET方式请求数据，这种方式下直接通过URL传递数据<br>可以通过 –data/-d 方式指定使用POST方式传递数据</p>
<pre><code># GET
curl -u username https://api.github.com/user?access_token=XXXXXXXXXX

# POST
curl -u username --data &quot;param1=value1&amp;param2=value&quot; https://api.github.com

# 也可以指定一个文件，将该文件中的内容当作数据传递给服务器端
curl --data @filename https://github.api.com/authorizations
</code></pre><p>注：默认情况下，通过POST方式传递过去的数据中若有特殊字符，首先需要将特殊字符转义在传递给服务器端，如value值中包含有空格，则需要先将空格转换成%20，如：</p>
<pre><code>curl -d &quot;value%201&quot; http://hostname.com
</code></pre><p>在新版本的CURL中，提供了新的选项 –data-urlencode，通过该选项提供的参数会自动转义特殊字符。</p>
<pre><code>curl --data-urlencode &quot;value 1&quot; http://hostname.com
</code></pre><p>除了使用GET和POST协议外，还可以通过 -X 选项指定其它协议，如：</p>
<pre><code>curl -I -X DELETE https://api.github.cim
</code></pre><p>上传文件</p>
<pre><code>curl --form &quot;fileupload=@filename.txt&quot; http://hostname/resource
</code></pre>
      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/linux/" rel="tag"># linux</a>
          
            <a href="/tags/curl/" rel="tag"># curl</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2015/04/28/ruby-rbenv-switch-ruby-version/" rel="prev" title="通过rbenv切换Ruby版本">
                通过rbenv切换Ruby版本 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2014/01/01/linux-commands-curl/"
     data-title="Linux常用命令注记——CURL"
     data-content=""
     data-url="http://chrisrc.me/2014/01/01/linux-commands-curl/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2014/01/01/linux-commands-curl/"
           data-title="Linux常用命令注记——CURL" data-url="http://chrisrc.me/2014/01/01/linux-commands-curl/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="chrisrc" />
          <p class="site-author-name" itemprop="name">chrisrc</p>
          <p class="site-description motion-element" itemprop="description"></p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">69</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">21</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">162</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/christtrc" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/chrisrc" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#参考资料"><span class="nav-number">1.</span> <span class="nav-text">参考资料</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#下载单个文件，默认将输出打印到标准输出中-STDOUT-中"><span class="nav-number">2.</span> <span class="nav-text">下载单个文件，默认将输出打印到标准输出中(STDOUT)中</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#通过-o-O选项保存下载的文件到指定的文件中："><span class="nav-number">3.</span> <span class="nav-text">通过-o/-O选项保存下载的文件到指定的文件中：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#同时获取多个文件"><span class="nav-number">4.</span> <span class="nav-text">同时获取多个文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#断点续传"><span class="nav-number">5.</span> <span class="nav-text">断点续传</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#对CURL使用网络限速"><span class="nav-number">6.</span> <span class="nav-text">对CURL使用网络限速</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#CURL授权"><span class="nav-number">7.</span> <span class="nav-text">CURL授权</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#从FTP服务器下载文件"><span class="nav-number">8.</span> <span class="nav-text">从FTP服务器下载文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#上传文件到FTP服务器"><span class="nav-number">9.</span> <span class="nav-text">上传文件到FTP服务器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#获取更多信息"><span class="nav-number">10.</span> <span class="nav-text">获取更多信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#通过字典查询单词"><span class="nav-number">11.</span> <span class="nav-text">通过字典查询单词</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#为CURL设置代理"><span class="nav-number">12.</span> <span class="nav-text">为CURL设置代理</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#保存与使用网站cookie信息"><span class="nav-number">13.</span> <span class="nav-text">保存与使用网站cookie信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#传递请求数据"><span class="nav-number">14.</span> <span class="nav-text">传递请求数据</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">
     
      <a href="mailto:chrisrc@qq.com">chrisrc</a> 
    
  </span>
  <span class="author"> &nbsp; QQ: 58122705 </span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"chrisrc"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  








  
  

  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
<script>
(function(){
   var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04":"https://jspassport.ssl.qhimg.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04";
   document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script>

  


</body>
</html>
